	function setTab(name,cursel){
		cursel_0=cursel;
			var agent=navigator.userAgent;
					if (agent.indexOf('Chrome')<0&&agent.indexOf('Safari')<0){
						var src=$($("#con_"+name+"_"+cursel).children()[0]).attr('src');
						$($("#con_"+name+"_"+cursel).children()[0]).attr('src',src);
					}
		for(var i=1; i<=links_len; i++){
			var menu = document.getElementById(name+i);
			var menudiv = document.getElementById("con_"+name+"_"+i);
			if(i==cursel){
				menu.className="off";
				menudiv.style.left="0";
			}
			else{
				menu.className="";
				menudiv.style.left="-999999px";
			}
		}
	}

	jQuery.fn.center = function(loaded) {
		var obj = this;
		body_width = parseInt($(window).width());
		body_height = parseInt( jQuery(window).height());
		block_width = parseInt(obj.width());
		block_height = parseInt(obj.height());
		left_position = parseInt((body_width / 2) - (block_width / 2) + $(window).scrollLeft());
		if (body_width < block_width) {
			left_position = 0 + $(window).scrollLeft();
		};
			top_position = parseInt((body_height / 2) - (block_height / 2) + $(window).scrollTop());
		if (body_height < block_height) {
			top_position = 0 + $(window).scrollTop();//
		};
		if (!loaded) {
			obj.css({
				'position': 'absolute'
			});
			obj.css({
				'top': top_position,
				'left': left_position
			});
			$(window).bind('resize',
			function() {
				obj.center(!loaded);
			});
			$(window).bind('scroll',
			function() {
				obj.center(!loaded);
			});
		} else {
			obj.stop();
			obj.css({
				'position': 'absolute'
			});
			obj.animate({
				'top': top_position
			},
			200, 'linear');
		}
	}

	function Next(){                                                        
		cursel_0++;
		if (cursel_0>links_len)cursel_0=1
		setTab(name_0,cursel_0);
	} 
	var name_0='one';
	var cursel_0=1;
	var links_len,iIntervalId;
	onload=function(){
		var links = document.getElementById("tab1").getElementsByTagName('li')
		links_len=links.length;
	}

	function Next(){                                                        
		cursel_0++;
		if (cursel_0>links_len)cursel_0=1
		setTab(name_0,cursel_0);
	} 
	var name_0='one';
	var cursel_0=1;
	var links_len,iIntervalId;
	onload=function(){
		var links = document.getElementById("tab1").getElementsByTagName('li')
		links_len=links.length;
	}

	$(document).ready(function(){
		$('.close-btn').click(function(){
			window.location.reload();
			$('.popbox').fadeOut(function(){ $('#screen').hide(); });
			return false;
		});
		
		$('.close-btn1').click(function(){
			window.location.reload();
			$('.popbox1').fadeOut(function(){ $('#screen').hide(); });
			return false;
		});
		
	});

	$('.popbox-link').click(function(e){
			window.scrollTo(0,0);
			var ev = e || window.e;
			ev.preventDefault();
			ev.stopPropagation();
			var h = $(document).height();
			$('#screen').css({ 'height': h });	
			$('#screen').show();
			var st = window.screen.availHeight / 2 - 350,
			    ts = window.screen.availWidth / 2 - 490;
			$('.popbox').show().css({'left': ts,'top':st});
			$('html,body').css('overflow','hidden');
			return false;
		});

	$(function(){
		
		$(".showbox").click(function(){
			$("#TB_overlayBG").css({
				display:"block",height:$(document).height()
			});
			 $(".box").css({
				//left:($("body").width()-$(".box").width())/2-20+"px",
				//top:"10%",
				display:"block"
			}),$('.box').center();
			
		});
		
		$(".close").click(function(){
			$("#TB_overlayBG").css("display","none");
			$(".box ").css("display","none");
		});
		
	})

	var d = document;
	var safari = (navigator.userAgent.toLowerCase().indexOf('safari') != -1) ? true : false;
	
	var gebtn = function(parEl,child) { return parEl.getElementsByTagName(child); };
	onload = function() {
		var body = gebtn(d,'body')[0];
		body.className = body.className && body.className != '' ? body.className + ' has-js' : 'has-js';
		if (!d.getElementById || !d.createTextNode) {
			return;
		}
		var ls = gebtn(d,'label');
		for (var i = 0; i < ls.length; i++) {
			var l = ls[i];
			if (l.className.indexOf('label_') == -1) {
				continue;
			}
			var inp = gebtn(l,'input')[0];
			if (l.className == 'label_check') {
				//l.className = (safari && inp.checked == true || inp.checked) ? 'label_check c_on' : 'label_check c_off';
				l.className = (safari && inp.checked == true || inp.checked) ? 'label_check c_off' : 'label_check c_on';
				l.onclick = check_it;
			};
			if (l.className == 'label_radio') {
				l.className = (safari && inp.checked == true || inp.checked) ? 'label_radio r_on' : 'label_radio r_off';
				l.onclick = turn_radio;
			};
		};
	};
	var check_it = function() {
		var inp = gebtn(this,'input')[0];
		if (this.className == 'label_check c_off' || (!safari && inp.checked)) {
			this.className = 'label_check c_on';
			if (safari) {
				inp.click();
			};
		} else {
			this.className = 'label_check c_off';
			if (safari){ 
				inp.click();
			};
		};
	};
	var turn_radio = function() {
		var inp = gebtn(this,'input')[0];
		if (this.className == 'label_radio r_off' || inp.checked) {
			var ls = gebtn(this.parentNode,'label');
			for (var i = 0; i < ls.length; i++) {
				var l = ls[i];
				if (l.className.indexOf('label_radio') == -1) {
					continue;
				};
				l.className = 'label_radio r_off';
			};
			this.className = 'label_radio r_on';
			if (safari){ 
				inp.click();
			};
		} else {
			this.className = 'label_radio r_off';
			if (safari) {
				inp.click();
			};
		};
	}; 
 
  
function reload_avatar(){
	/*$.post("/user/getavatar",{},function(ret){
		alert($('#just_test').val());
		//alert($('#jz_searchTxt').find('li').find('img').attr('src'));
		//$('#jz_searchTxt img').attr('src',ret.res);
	});*/
	//window.location.reload();
}
 
 var txtobj={
   divName:"area", //外层容器的class
   textareaName:"chackTextarea", //textarea的class
   numName:"num", //数字的class
   num:140 //数字的最大数目
  }
  
  var textareaFn=function(){
   //定义变量
   var $onthis;//指向当前
   var $divname=txtobj.divName; //外层容器的class
   var $textareaName=txtobj.textareaName; //textarea的class
   var $numName=txtobj.numName; //数字的class
   var $num=txtobj.num; //数字的最大数目
   
   function isChinese(str){  //判断是不是中文
    var reCh=/[u00-uff]/;
    return !reCh.test(str);
   }
   function numChange(){
    var strlen=0; //初始定义长度为0
    var txtval = $.trim($onthis.val());
    for(var i=0;i<txtval.length;i++){
     if(isChinese(txtval.charAt(i))==true){
      strlen=strlen+2;//中文为2个字符
     }else{
      strlen=strlen+1;//英文一个字符
     }
    }
    strlen=Math.ceil(strlen/2);//中英文相加除2取整数
    if($num-strlen<0){
     $par.html("超出 <b style='color:red;font-weight:lighter' class="+$numName+">"+Math.abs($num-strlen)+"</b> 字"); //超出的样式
    }
    else{
     $par.html("还可以输入 <b class="+$numName+">"+($num-strlen)+"</b> 字"); //正常时候
    }
    $b.html($num-strlen);   
   }
   $("."+$textareaName).live("focus",function(){
    $b=$(this).parents("."+$divname).find("."+$numName); //获取当前的数字
    $par=$b.parent(); 
    $onthis=$(this); //获取当前的textarea
    var setNum=setInterval(numChange,500);    
   });
  }     
  textareaFn();
  
  (function( $ ) {

	$.fn.rlAccordion = function(method, options) {
		var settings = $.extend({
			rlAccordion: "rlAccordion", 		
			signTag: "<span></span>", 			
			titles: "a",			 			
			titlesChild: "span",						
			container: "div",								
			childNum: 0,										
			classOpen: "opened",						
			open: "&#x2b;",  								
			close: "&#x2212;",							
			rlOpen: "rl-open", 							
			rlClose: "rl-close" 						
		}, options);

		var $element = $(this).children(settings.titles); 		
		var $symbols = $(settings.signTag); 									
		var $signOpen = $symbols.html(settings.open); 				
		var $signClose = $symbols.html(settings.close); 			
		var $insertElement = $symbols.appendTo($element); 		

		$element.parent().addClass(settings.rlAccordion);

		if ( $element.next().hasClass(settings.classOpen) ) {
			$element.children().html(settings.close).addClass(settings.rlClose);
		}
		else {
			$element.children().html(settings.open).addClass(settings.rlOpen);
		}

		var methods = {
			init : function() { 
				return this.each(function() {

					$(this).find(settings.container).eq(settings.childNum).addClass(settings.classOpen).slideDown()
								 .prev().children().html(settings.close).removeClass(settings.rlOpen).addClass(settings.rlClose); 

					$element.on('click', function() {
						$(this).parent().find(settings.container).removeClass(settings.classOpen).slideUp();
						$(this).parent().find(settings.titles).children().html(settings.open);
						$(this).next().addClass(settings.classOpen).slideDown();

						if ( $(this).children().hasClass(settings.rlClose) ) {
								 $(this).next().stop();
						}

						if ( $(this).next().hasClass(settings.classOpen) ) {
								 $(this).parent().find(settings.titlesChild).removeClass(settings.rlClose).addClass(settings.rlOpen);
								 $(this).children().html(settings.close).removeClass(settings.rlOpen).addClass(settings.rlClose);
						}
						else {
							$(this).children().html(settings.open).removeClass(settings.rlClose).addClass(settings.rlOpen);
						}
					});
				});
			},

			single : function() {
				return this.each(function() {

					$(this).find(settings.container).eq(settings.childNum).addClass(settings.classOpen).slideDown()
								 .prev().children().html(settings.close).removeClass(settings.rlOpen).addClass(settings.rlClose);

					$element.on('click', function() {
						$(this).next().slideToggle().toggleClass(settings.classOpen);
						if ($(this).next().hasClass(settings.classOpen)) {
								$(this).children().html(settings.close).removeClass(settings.rlOpen).addClass(settings.rlClose);
						}
						else {
							$(this).children().html(settings.open).removeClass(settings.rlClose).addClass(settings.rlOpen);
						}
					});
				});
			},

			mix : function() {
				return this.each(function() {

					$(this).find(settings.container).eq(settings.childNum).addClass(settings.classOpen).slideDown()
								 .prev().children().html(settings.close).removeClass(settings.rlOpen).addClass(settings.rlClose); 

					$element.on('click', function() {
						if ( $(this).next().hasClass(settings.classOpen) ) {
								 $(this).parent().find(settings.container).removeClass(settings.classOpen).slideUp();
								 $(this).parent().find(settings.titles).children().html(settings.open).removeClass(settings.rlClose).addClass(settings.rlOpen);
								 $(this).children().html(settings.open);
						}
						else {
							$(this).parent().find(settings.container).removeClass(settings.classOpen).slideUp();
							$(this).next().addClass(settings.classOpen).slideDown();
							$(this).parent().find(settings.titles).children().html(settings.open).removeClass(settings.rlClose).addClass(settings.rlOpen);
							$(this).children().html(settings.close).removeClass(settings.rlOpen).addClass(settings.rlClose);
						}
					});
				});
			}
		};

		// Method calling logic
		if ( methods[method] ) {
			return methods[ method ].apply( this, Array.prototype.slice.call( arguments, 1 ));
		} else if ( typeof method === 'object' || ! method ) {
			return methods.init.apply( this, arguments );
		} else {
			$.error( 'Method ' +  method + ' does not exist on jQuery.rlAccordion ' );
		}
	};

})( jQuery );
  
 
 
 
 
 
 
 
 

